<?php
//=========================
//Vuong Van Binh
//Wanbin@vietnambiz.com
//edit user process
//=========================
include ADMIN_INCLUDE_DIR."/header.php";
edit_user();
$user_edit_info = get_user_edit();
?>
<div class="container_l">
		<div class="title_user"><img src="images/icon1.gif" />Cập nhật thông tin người quản trị</div>
		<div class="table_user">
			<div class="table_user_in2">
			<?php 
					show_error(); 
					show_success(); 
			?>
				<fieldset>
				<form action="" method="post">
					<legend accesskey="N">Thông tin người quản trị</legend>
					<div class="lineaddnew">
						<div class="lineform">
							<div class="divlabel">Tên đăng nhập: <font color="#FF0000">*</font></div>
							<div class="divform"><input type="text" name="username" value="<?php echo $user_edit_info["username"]; ?>"/></div>
						</div>
						<div class="lineform">
							<div class="divlabel">Mật khẩu: <font color="#FF0000">*</font></div>
							<div class="divform"><input type="password" name="password" value="" /></div>
						</div>
						<div class="lineform">
							<div class="divlabel">Nhập lại mật khẩu: <font color="#FF0000">*</font></div>
							<div class="divform"><input type="password" name="repassword" value="" /></div>
						</div>
						<div class="lineform">
							<div class="divlabel">Email: <font color="#FF0000">*</font></div>
							<div class="divform"><input type="text" name="email" value="<?php echo $user_edit_info["email"]; ?>" /></div>
						</div>
						
						<div class="lineform">
							<div class="divlabel">Quyền: <font color="#FF0000">*</font></div>
							<div class="divform">
							   <?php
							        $array_module = $CONFIG['array_modules_list'];
									
									$arr_permiss  = explode(',',$user_edit_info["permiss"]);
									
									//print_r($arr_permiss);
							        foreach ($array_module as $key=>$value){
									  
									  $checked ="";
									  
									  if(in_array($key,$arr_permiss)){
									  
									        $checked = "checked='checked'";
											
									  }
									  
									  echo "<input type='checkbox' name='permiss[]' value='".$key."' ".$checked." style='width:3%; background:none; border:none;' />";
									  echo "<font class='textbody'>".$array_module[$key]."</font>&nbsp;&nbsp;";
									  
									}
							   ?>	

							</div>
						</div>
						
						<div class="lineform">
							<div class="divlabel">Cho phép hoạt động: <font color="#FF0000">*</font></div>
							<div style="float:left; padding:5px;">
							<select name="active" style="float:left; padding:2px; width:50px;">
								<?php
								if($user_edit_info["active"]=="yes"){
								?>
								<option value="yes" selected="selected">Có</option>
								<option value="no">Không</option>
								<?php }else{ ?>
								<option value="yes">Có</option>
								<option value="no" selected="selected">Không</option>
								<?php } ?>
							</select>
							</div>
							
						</div>
						
						<div class="spacer1"><span></span></div>
					</div>
					<div class="spacer1"><span></span></div>
				</fieldset>
				
				<div class="linesubmit">
					<input type="hidden" name="edituser" value="okie" />
					<input type="submit" name="edituser" value="Cập nhật" class="button" />
					<input type="submit" name="exit" value="Cập nhật và thoát" class="button" />
					<input type="button" name="back" value="Quay lại" class="button" onclick="javascript:history.back();" />
					<input type="hidden" name="edit_id" value="<?php echo intval($_GET["id"]); ?>"  />
				</div>
			</form>
				
			</div>
		</div>
	</div>
<?php
include "inc/right.php"; 
include ADMIN_INCLUDE_DIR."/footer.php"; 
?>